﻿
/*----------------------------------------------------------------//
// 文件名：MoRefFile.cs
// 文件功能描述：实体 MoRefFile.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoRefFile
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoRefFile
    /// </summary>
    public partial class MoRefFile : ICloneable
    {
        #region 表RefFile的字段
        private string rfId;
        private string fileId;
        private string eid;
        #endregion

        #region 构造函数
        public MoRefFile()
        {


        }
        #endregion

        #region 拷贝构造函数

        public MoRefFile(MoRefFile item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoRefFile(string rfId, string fileId, string eid)
        {
            this.rfId = rfId;
            this.fileId = fileId;
            this.eid = eid;
        }
        #endregion

        #region 表RefFile的字段属性
        /// <summary>
        /// RF_ID
        /// </summary>
        public string RfId
        {
            get { return rfId; }
            set { rfId = value; }
        }
        /// <summary>
        /// FILE_ID
        /// </summary>
        public string FileId
        {
            get { return fileId; }
            set { fileId = value; }
        }
        /// <summary>
        ///实际是一个外键。那个实体关联了一个文件，那么那个实体的主键则记录到这里。
        /// </summary>
        public string Eid
        {
            get { return eid; }
            set { eid = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoRefFile CopyTo(MoRefFile item)
        {
            item.rfId = this.rfId;
            item.fileId = this.fileId;
            item.eid = this.eid;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoRefFile mo = new MoRefFile();
            mo.RfId = this.RfId;
            mo.FileId = this.FileId;
            mo.Eid = this.Eid;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoRefFile NewRefFile = obj as MoRefFile;
                if (NewRefFile == null)
                {
                    return false;
                }
                else
                {
                    if (NewRefFile.RfId == this.RfId && NewRefFile.FileId == this.FileId && NewRefFile.Eid == this.Eid)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "RfId={0}/FileId={1}/Eid={2}", rfId, fileId, eid);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["RF_ID"] != null && row["RF_ID"] != DBNull.Value)
            {
                this.RfId = (string)row["RF_ID"];
            }
            else
            {
                this.RfId = string.Empty;
            }
            if (row["File_ID"] != null && row["File_ID"] != DBNull.Value)
            {
                this.FileId = (string)row["File_ID"];
            }
            else
            {
                this.FileId = string.Empty;
            }
            if (row["EID"] != null && row["EID"] != DBNull.Value)
            {
                this.Eid = (string)row["EID"];
            }
            else
            {
                this.Eid = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["RF_ID"] = this.RfId;
            row["File_ID"] = this.FileId;
            row["EID"] = this.Eid;
        }
        #endregion
    }
}
#endregion
